import request from '@/axios';


export function saveResource(data) {
    return request({
        url: '/resource/save',
        method: 'post',
        params: data
    })
}

export function deleteResource(id) {
    return request({
        url: '/resource/' + id,
        method: 'delete'
    })
}

export function findById(id) {
    return request({
        url: '/resource/' + id,
        method: 'get'
    })
}

export function getResource() {
    return request({
        url: '/resource/getResource',
        method: 'get'
    })
}

export function queryResource(queryParam) {
    return request({
        url: '/resource/queryResource',
        method: 'get',
        params: queryParam
    })
}

export function findAllResource() {
    return request({
        url: '/resource/getResourceList',
        method: 'get'
    })
}

export function getRightList(id) {
    if (id) {
        return request({
            url: '/resource/findRightList/' + id,
            method: 'get'
        });
    }
    return request({
        url: '/resource/findRightList',
        method: 'get'
    });

}
